package com.huawei.appmarket.component.feedback.activity;

import android.app.ActionBar;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.huawei.appgallery.foundation.ui.framework.activity.AbstractBaseActivity;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.e;
import com.huawei.appgallery.foundation.ui.framework.fragment.LoadingFragment;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import java.util.List;
import o.azc;
import o.cgv;
import o.cvt;
import o.dff;
import o.dfj.a;
import o.dfj.d;
import o.dfj.h;
import o.dfo;
import o.FragmentTransaction;

public class FeedbackListDetailActivity extends AbstractBaseActivity<FeedbackListActivityProtocol> implements e {
    private View ˏॱ;
    private TextView ॱˊ;

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(b.ˋ);
        this.ˏॱ = findViewById(a.ˋॱ);
        this.ॱˊ = (TextView) this.ˏॱ.findViewById(a.ʼॱ);
        ᐝॱ();
        FeedbackListActivityProtocol feedbackListActivityProtocol = (FeedbackListActivityProtocol) ʾ();
        if (feedbackListActivityProtocol == null || feedbackListActivityProtocol.ˋ() == null) {
            finish();
        } else {
            ᐝ();
        }
    }

    private void ᐝ() {
        new LoadingFragment().ˋ(ˏॱ(), a.ॱˊ, "TaskFragment");
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() != 16908332) {
            return super.onOptionsItemSelected(menuItem);
        }
        finish();
        return true;
    }

    private void ͺ() {
        this.ˏॱ.setVisibility(8);
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayOptions(12);
            actionBar.setDisplayShowCustomEnabled(false);
            actionBar.show();
            actionBar.setTitle(h.ᐝ);
        }
    }

    private void ॱˊ() {
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        this.ॱˊ.setText(h.ᐝ);
        findViewById(a.ॱˋ).setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ FeedbackListDetailActivity ˊ;

            {
                this.ˊ = r1;
            }

            public void onClick(View view) {
                this.ˊ.onBackPressed();
            }
        });
    }

    private void ᐝॱ() {
        if (azc.ˎ().ॱ() >= 17) {
            ͺ();
        } else {
            ॱˊ();
        }
        cgv.ˊ(this, d.ˋ);
    }

    public boolean ˋ(TaskFragment taskFragment, TaskFragment.b bVar) {
        if (bVar != null && bVar.ˋ != null && bVar.ˋ.getResponseCode() == 0) {
            ResponseBean responseBean = bVar.ˋ;
            if (responseBean instanceof FeedbackListDetailResponse) {
                Fragment ॱ = FeedbackListDetailFragment.ॱ(((FeedbackListDetailResponse) responseBean).ˎ());
                FragmentTransaction ˊ = ˏॱ().ˊ();
                ˊ.ˏ(a.ॱˊ, ॱ, "fragment_tag");
                ˊ.ˋ();
            }
        } else if (taskFragment != null && (taskFragment instanceof LoadingFragment)) {
            LoadingFragment loadingFragment = (LoadingFragment) taskFragment;
            dfo ˎ = dfo.ˎ(bVar.ˊ, bVar.ˋ, null);
            loadingFragment.ˏ(ˎ.ॱ(), ˎ.ˊ());
        }
        return false;
    }

    public void ˎ(TaskFragment taskFragment, List<cvt> list) {
        dff o_dff = new dff();
        o_dff.ˎ(((FeedbackListActivityProtocol) ʾ()).ˋ().ॱ());
        list.add(o_dff);
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 1011 && i2 == 1012) {
            finish();
        }
    }
}
